package com.qfedu.buy.server.controller;

import com.qfedu.buy.common.dto.PayDto;
import com.qfedu.buy.common.vo.R;
import com.qfedu.buy.server.dao.PayDao;
import com.qfedu.buy.server.service.intf.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: NeighborBuy
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2021-02-01 15:01
 */
@RestController
@RequestMapping("/server/pay/")
public class PayController {
    @Autowired
    private PayService service;

    //
    @PostMapping("createpay.do")
    public R create(@RequestBody PayDto dto){
        return service.createPay(dto);
    }
    @GetMapping("querypay.do")
    public R query(@RequestParam String oid){
        return service.queryPay(oid);
    }
    @PostMapping("closepay.do")
    public R close(@RequestParam String oid){
        return service.closePay(oid);
    }
    @GetMapping("allpay.do")
    public R all(){
        return service.all();
    }
}
